/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.unifor.redes1.odirabel;

import br.unifor.redes1.odirabel.gui.client.JFrameClient;
import br.unifor.redes1.odirabel.gui.server.JFrameServer;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author U013876
 */
public class Main {

    public static void main(String args[]) {
        try {
            ConfigProperties.getInstance();
            // Get the currently installed look and feel
            LookAndFeel lf = UIManager.getLookAndFeel();
            // Install a different look and feel; specifically, the Windows look and feel
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            } catch (Exception e) {
                JOptionPane.showConfirmDialog(null, e.getMessage());
            }
            String[] choices = {"Servidor", "Cliente"};
            int response = JOptionPane.showOptionDialog(null, "Deseja entrar em que modo?", "Selecione um modo.", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choices, "Cliente");
            if (response == 0) {
                new JFrameServer().setVisible(true);
            } else if (response == 1) {
                new JFrameClient().setVisible(true);
            }
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
